package abstractEntities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import entities.Itens;
import entities.Language;
import entitiesIds.LanguageitemId;

/**
 * AbstractLanguageitem entity provides the base persistence definition of the
 * Languageitem entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractLanguageitem implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 612756083870964912L;
	private LanguageitemId id;
	private Itens itens;
	private Language language;
	private String itemName;
	private String itemDescription;

	// Constructors

	/** default constructor */
	public AbstractLanguageitem() {
	}

	/** full constructor */
	public AbstractLanguageitem(LanguageitemId id, Itens itens,
			Language language, String itemName, String itemDescription) {
		this.id = id;
		this.itens = itens;
		this.language = language;
		this.itemName = itemName;
		this.itemDescription = itemDescription;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idItem", column = @Column(name = "idItem", nullable = false)),
			@AttributeOverride(name = "abb", column = @Column(name = "abb", nullable = false, length = 5)) })
	public LanguageitemId getId() {
		return this.id;
	}

	public void setId(LanguageitemId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idItem", nullable = false, insertable = false, updatable = false)
	public Itens getItens() {
		return this.itens;
	}

	public void setItens(Itens itens) {
		this.itens = itens;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "abb", nullable = false, insertable = false, updatable = false)
	public Language getLanguage() {
		return this.language;
	}

	public void setLanguage(Language language) {
		this.language = language;
	}

	@Column(name = "itemName", nullable = false)
	public String getItemName() {
		return this.itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	@Column(name = "itemDescription", nullable = false, length = 1500)
	public String getItemDescription() {
		return this.itemDescription;
	}

	public void setItemDescription(String itemDescription) {
		this.itemDescription = itemDescription;
	}

}